xen/common: Avoid undefined behaviour by shifting into a sign bit
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 5 Aug 2016 13:22:48 +0000 (14:22 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 11 Aug 2016 09:08:43 +0000 (10:08 +0100)
commit26ce62d7763808f866c05a2e747583023f664a1f
tree479eb4f30c5654f0a2f2d3d16581b8b7bb7ef8de
parent6480cc6280e955d1245d8dfb2456d2b830240c74
xen/common: Avoid undefined behaviour by shifting into a sign bit

For d->shutdown_code, change the field to being unsigned and using an unsigned
sentinel.  The sentinal needs to be distinguishable from any value
representable in a u8.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/domain.c
xen/common/schedule.c
xen/common/xmalloc_tlsf.c
xen/include/xen/sched.h